
<?php

// This file is part of the Carrington Text Theme for WordPress
// http://carringtontheme.com
//
// Copyright (c) 2008-2009 Crowd Favorite, Ltd. All rights reserved.
// http://crowdfavorite.com
//
// Released under the GPL license
// http://www.opensource.org/licenses/gpl-license.php
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
// **********************************************************************

if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); }
if (CFCT_DEBUG) { cfct_banner(__FILE__); }


get_header();
global $wp_query;

?>
<div id="main">
	<h1 class='editorial-title'>
		<?php
			echo $_GET['year'];
			the_title(); 
		?>
	</h1>
	<br>
	<h3>Select a year to filter the articles:</h3>
	
	<ul class="yearNav">
		<li><a onClick='window.location.href=window.location.href+"?year=2011"'>2011</a></li>
		<li><a onClick='window.location.href=window.location.href+"?year=2010"'>2010</a></li>
		<li><a onClick='window.location.href=window.location.href+"?year=2009"'>2009</a></li>
		<li><a onClick='window.location.href=window.location.href+"?year=2008"'>2008</a></li>
		<li><a onClick='window.location.href=window.location.href+"?year=2007"'>2007</a></li>
	</ul>
	
	<div id="news">

<?php

$thePageSlug = $wp_query->post->post_name;

if($thePageSlug == 'news')
{
	query_posts('category_name=news&showposts=10');
}else if($thePageSlug == 'press-release')
{
	query_posts('category_name=press-release&showposts=10');
}else if($thePageSlug == 'focus-on')
{
	query_posts('category_name=focus-on&showposts=10');
}else
{
	query_posts('category_name=mediacenter&showposts=10');
}

while (have_posts()) : the_post(); 

	$category = get_the_category($post->ID);
?>
	<article class='highlight'>
		<h3><?php echo $category[1]->cat_name; ?></h3>
		<a href='<?php the_permalink(); ?>'>
		<img src="<?php bloginfo('template_url') ?>/img/thumb-1.jpg">
		<p><?php the_excerpt();?></p>
		</a>
	</article>

<?php endwhile;?> 

</div>
</div>

<?php get_footer(); ?>


